package
{
	import mx.containers.Box;
	import mx.controls.Text;
	import mx.events.FlexEvent;

	[Bindable]
	public class BoxText extends Box
	{
		public function BoxText()
		{
			super();			
			this.addEventListener(FlexEvent.CREATION_COMPLETE, creationComplete);
		}
		
		private function creationComplete(event:FlexEvent):void
		{
			_textField.text = text;
			this.addChild(_textField);
		}

		private var _text:String;
		public function get text():String
		{
			return _text;
		}
		public function set text(s:String):void
		{
			_textField = new Text();
			_textField.text = text;
			_textField.invalidateSize();
			
		}
		private var _textField:Text = new Text();
		
	}
}